﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Blog.TemplateEngine.Helpers;

namespace Blog.TemplateEngine
{
    class VariableParameter : IParameter
    {
        string mVariable;
        public VariableParameter(string variable)
        {
            mVariable = variable;
        }

        protected object Value(Context context)
        {
            return VariableResolver.Resolve(context, mVariable);
        }

        object IParameter.Value(Context context)
        {
            return Value(context);
        }

        string IParameter.AsString(Context context)
        {
            return Value(context).ToString();
        }
    }
}
